@extends('layout.app') @section('content')

<div class="box-body">

    <table id="rowed3"></table>
    <div id="prowed3"></div>

</div>

<script>
    $(document).ready(function() {

        var data = {
            url: "/zongdai/record",
            colNames: [ '开奖时间', '开奖期数', '伙伴ID', '伙伴昵称', '隶属合伙人', '伙伴开奖时余额', '下注总额(去佣金)', '开奖结果', '伙伴盈利', '伙伴比例(%)'],
            colModel: [{
                name: 'create_time',
                formatter:'date',
                formatoptions: {srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'},
                searchoptions: {
                    sopt: ['lt', 'le', 'gt', 'ge'],
                    dataInit : function (elem) {
                        $(elem).datepicker({
                            dateFormat: 'yy-mm-dd',
                            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
                            dayNamesMin: ['日','一','二','三','四','五','六'] });
                    }
                }
            }, {
                name: 'number',
            }, {
                name: 'user_id',
            }, {
                name: 'nickname',
            },{
                name: 'chao_zongdai',
                stype: 'select',
                searchoptions: {
                    sopt: ["eq" , "ne"],
                    value: "{{$rs}}"
                },
                editable: true,
                edittype: 'select',
                editoptions: {
                    value: "{{$rs}}"
                },
                formatter: function(cellvalue, options, object) {
                    return object.rs;
                }
            },  {
                name: 'money',
            }, {
                name: 'spend',
                formatter: function(cellvalue, options, object) {
                    return '<a href="/lottery/touzhu?zongdai='+object.user_id+'&number='+object.number+'"><span class="text-success">'+cellvalue+'</span></a>';
                }
            }, {
                name: 'kjcode',
                search: false,
                formatter: function(cellvalue,options,row) {
                    if(!cellvalue) {
                        return '-';
                    }
//                     var arr = cellvalue.split(",");
//                     num = arr[0]*1+arr[1]*1+arr[2]*1;
                    if (cellvalue % 2 == 1) {
                        ds = '单';
                    } else {
                        ds = '双';
                    }
//                     if (num > 13) {
//                         dx = '大';
//                     } else {
//                         dx = '小';
//                     }
                    return cellvalue + '('+ds+')';
                }
            }, {
                name: 'win',
                sortable: false,
                search: false,
                formatter: function(cellvalue) {
                    if (cellvalue > 0) {
                    	return '<span class="text-success"></i> +' + cellvalue + '</span>';
                    } else {
                    	return '<span class="text-danger"></i> ' + cellvalue + '</span>';
                    }
                }
            },{
                name: 'ratio'
            }],
            caption: '<i class="fa fa-table"></i> {{$label2}}',
            sortname: 'create_time',
            sortorder: "desc",
        };

        jqGrid(data);
    });

</script>

@endsection